package com.yonyou.pmclouds.plan.entity;


import com.yonyou.pmclouds.basecom.entity.SuperVO;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;

@EqualsAndHashCode(callSuper = true)
@Data
@Table(name = "pm_schedule")
public class ScheduleVO extends SuperVO {

    private static final long serialVersionUID = -4692137283760523382L;

    public static final String NAME = "name";

    public static final String PROGRESS = "progress";

    public static final String START_DATE = "startDate";

    public static final String END_DATE = "endDate";

    public static final String CREATOR = "creator";

    public static final String CREATOR_NAME = "creatorName";

    public static final String LAST_FLAG = "lastFlag";

    public static final String BILL_STATUS = "billstatus";

    public static final String MODIFIER = "modifier";

    public static final String MODIFY_TIME = "modifytime";

    public static final String PLAN_START_DATE = "planStartDate";

    public static final String PLAN_END_DATE = "planEndDate";

    public static final String PLAN_DAYS = "planDays";

    public static final String CHANGE_FLAG = "changeFlag";

    public static final int SCHEDULE_ITEM_COMPLETE = 100;

    @Id
    @NotNull(groups = UpdateValid.class)
    private String pkSchedule;

    @NotNull(groups = InsertValid.class)
    private String pkTenant;

    @NotNull(groups = InsertValid.class)
    private String pkProject;

    @Size(max = 50)
    @NotNull
    private String name;

    private String code;

    private int seq;

    @NotNull
    private Date planStartDate;

    @NotNull
    private Date planEndDate;

    @NotNull
    private Integer planDays;

    @Size(max = 300)
    private String description;

    private String creator;

    private Date creationtime;

    private String modifier;

    private Date modifytime;

    private String pkSrc;

    private byte billstatus;

    private int version;

    private String lastFlag;

    private String billType;

    private String pkOriginal;

    @Transient
    private ScheduleItemVO[] scheduleItemVOS;

    @Transient
    private int childCount;

    @Transient
    private String failedCommit;

    @Transient
    private String[] deletePlan;

    @Transient
    private Integer progress;

    @Transient
    private Date startDate;

    @Transient
    private Date endDate;

    @Transient
    private String creatorName;

    // 上一版本主键，调整时使用
    @Transient
    private String oldPkSchedule;

    @Transient
    private String projectCode;
    @Transient
    private String projectManager;
    @Transient
    private Boolean isKey;
    @Transient
    private String pkOrg;
    @Transient
    private String projectName;
    @Transient
    private byte projectState;

    public interface UpdateValid {
    }

    public interface InsertValid {
    }
}
